package test_junit_merchant.MarketSold;

import org.openqa.selenium.By;
import org.openqa.selenium.support.ui.Select;
import util.BaseDriver;

public class AddMemberRank extends BaseDriver{

    private static AddMemberRank instance=new AddMemberRank();
    private AddMemberRank(){}


    public static AddMemberRank getInstance(){
        return instance;
    }


    public void addMemberRank(){
        driver=driver.switchTo().frame(2);
        //新增button
        driver.findElement(By.cssSelector("button.btn.btn-sm.btn-outline.btn-primary")).click();
        driver=driver.switchTo().frame(0);
        driver.findElement(By.id("type")).click();

        new Select(driver.findElement(By.id("type"))).selectByVisibleText("零售客户");
        driver.findElement(By.cssSelector("option[value=\"1\"]")).click();
        driver.findElement(By.id("levelName")).click();
        driver.findElement(By.id("levelName")).clear();
        driver.findElement(By.id("levelName")).sendKeys("22");
        driver.findElement(By.id("shoppingDiscount")).click();
        driver.findElement(By.id("shoppingDiscount")).clear();
        driver.findElement(By.id("shoppingDiscount")).sendKeys("10");
        driver.findElement(By.id("buildDiscount")).click();
        driver.findElement(By.id("buildDiscount")).clear();
        driver.findElement(By.id("buildDiscount")).sendKeys("10");
        driver.findElement(By.id("autho")).click();
        driver.findElement(By.id("autho")).clear();
        driver.findElement(By.id("autho")).sendKeys("200");
        driver.findElement(By.id("costMoney")).click();
        driver.findElement(By.id("costMoney")).clear();
        driver.findElement(By.id("costMoney")).sendKeys("10");
        driver.findElement(By.id("morePoint")).click();
        driver.findElement(By.id("morePoint")).clear();
        driver.findElement(By.id("morePoint")).sendKeys("10");
        driver.findElement(By.id("maxPoint")).click();
        driver.findElement(By.id("maxPoint")).clear();
        driver.findElement(By.id("maxPoint")).sendKeys("100");
        driver.findElement(By.id("validity")).click();
        driver.findElement(By.id("validity")).clear();
        driver.findElement(By.id("validity")).sendKeys("10");
        driver.findElement(By.id("chargeMoney")).click();
        driver.findElement(By.id("chargeMoney")).clear();
        driver.findElement(By.id("chargeMoney")).sendKeys("10");
        driver.findElement(By.id("common")).click();
        driver.findElement(By.id("common")).clear();
        driver.findElement(By.id("common")).sendKeys("2");
        driver.findElement(By.id("tokens")).click();
        driver.findElement(By.id("tokens")).clear();
        driver.findElement(By.id("tokens")).sendKeys("100");
        driver.findElement(By.id("pps")).click();
        driver.findElement(By.id("pps")).clear();
        driver.findElement(By.id("pps")).sendKeys("100");
        driver.findElement(By.id("scard")).click();
        driver.findElement(By.id("scard")).clear();
        driver.findElement(By.id("scard")).sendKeys("10");
        driver.findElement(By.id("confirm")).click();

    }






}
